package com.lixinlei.springboot_servlet.filter.webfilter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(filterName = "myFilter", urlPatterns = "/my/web/servlet")
public class MyFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("-------com.lixinlei.springboot_servlet.filter.webfilter.MyFilter.doFilter(before)------");
        chain.doFilter(request, response);
        System.out.println("-------com.lixinlei.springboot_servlet.filter.webfilter.MyFilter.doFilter(after)------");
    }

}
